/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package managers;

import DAO.InformeDAO;
import JPA.JPAInformeDAO;
import domain.Entity.EntityInforme;
import java.util.List;
import javax.servlet.http.HttpSession;
import domain.Entity.EntityTrabajador;
import domain.Entity.EntityUsuario;
import java.util.Date;

/**
 *
 * @author jorge
 */
public class InformeManager implements InformeManagerInterface {
     
     private InformeDAO informe;
     private static InformeManager instance = null;
        
  	
        public static synchronized InformeManager getInstance(){
		if(instance == null){
			instance = new InformeManager();
			return instance;
		}
		else
			return instance;
	}
        
	
	private InformeManager(){
		this.informe =new JPAInformeDAO();
	}

        public void addInforme(EntityUsuario eu, String tipo, String subtipo, String url, String nombre){
        
            EntityInforme ei = new EntityInforme();
            ei.setEu(eu);
            ei.setTipo(tipo);
            ei.setSubtipo(subtipo);
            ei.setUrl(url);
            ei.setNombre(nombre);
            this.informe.anadirInforme(ei);
        }
        
        public List<EntityInforme> listarInformes(long dni){
    	 return this.informe.listarInformes(dni);
        }
        
        public void borrarInforme(long idInforme){
            this.informe.borrarInforme(idInforme);
        }

}
